<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
<!DOCTYPE html>
<html>
<head>
    <title>
       修改密码
    </title>

    <script type="text/javascript" charset="utf-8" src="${ctx}/static/inspinia/js/plugins/ueditor-1.4.3.3/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="${ctx}/static/inspinia/js/plugins/ueditor-1.4.3.3/_examples/editor_api.js"></script>
    <script type="text/javascript" charset="utf-8" src="${ctx}/static/inspinia/js/plugins/ueditor-1.4.3.3/lang/zh-cn/zh-cn.js"></script>

</head>

<body>

<div id="wrapper">
    <div class="gray-bg">
        <div class="row m-t-sm">
            <div class="col-lg-12">
                <ol class="breadcrumb f-fl">
                    <li>
                        <i class="fa fa-location-arrow"></i><a>修改密码</a>
                    </li>
                    <c:if test="${sys_flag}">
                        <li class="active">
                            <strong>
                                修改密码
                            </strong>
                        </li>
                    </c:if>
                </ol>
                    <span class="navbar-right  m-r m-t-8"><a href="javascript:history.go(-1);" class="btn-primary btn-add "> <i class='fa fa-mail-reply'></i> 返回</a></span>
            </div>
        </div>
        <div class="wrapper wrapper-content animated fadeInRight">
            <div class="row">
                <div class="col-lg-12">
                    <div class="ibox float-e-margins">
                        <div class="ibox-content">
                            <form method="get"
                                  <c:if test="${sys_flag}">data-ajax="${ctx}/admin/ehm/user/list" </c:if>
                                  <c:if test="${!sys_flag}">data-ajax="${ctx}/admin/ehm/user/info/edit" </c:if>
                                  action="${ctx}/admin/ehm/user/save"  class="form-horizontal" id="user_form">
                                <input  type="hidden" id="ids" name="id" value="${data.id}"/>
                                <input  type="hidden" id="uid" name="uid" value="${data.uid}"/>
                                <div class="form-group">


                                <div class="form-group">
                                    <label class="col-sm-2 control-label"><span class="text-danger">*</span>新密码</label>
                                    <div class="col-sm-3">
                                        <input id="pas1" type="text" class="form-control"  placeholder="新密码" value=""  required >
                                    </div>
                                </div>
                                    <div class="form-group">
                                        <label class="col-sm-2 control-label"><span class="text-danger">*</span>密码确认</label>
                                        <div class="col-sm-3">
                                            <input id="pas2" type="text" class="form-control" placeholder="密码确认" value=""  required >
                                        </div>
                                    </div>
                                <div class="hr-line-dashed"></div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-2">
                                        <button class="btn btn-primary" type="button" onclick="save()">保 存</button>
                                        <a href="javascript:history.go(-1);" class="btn btn-white ">  取消</a>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<script type="text/javascript" src="${ctx}/static/inspinia/js/plugins/LD.sot/multiupf/uploadify2/jquery.uploadify.min.js"></script>
<script type="text/javascript" src="${ctx}/static/inspinia/js/plugins/LD.sot/multiupf/uploadify2/swfobject.js"></script>
<script type="text/javascript" src="${ctx}/static/inspinia/js/plugins/LD.sot/multiupf/multiupf.uploadify2.js"></script>
<script>

    function save() {
        var pas1 = $("#pas1").val();
        var pas2 = $("#pas1").val();

        if(pas1 == null || pas1 == undefined || pas1 == ''){
           parent.layer.msg("新密码为空")
            return;
        }

        if(pas2 == null || pas2 == undefined || pas2 == ''){
            parent.layer.msg("确认密码为空")
            return;
        }

        if(pas1 != pas2){
            parent.layer.msg("两次密码输入不一致")
            return;
        }

        $.ajax({
            type: "POST",
            url: "${ctx}/admin/ehm/update/save",
            data : {
                "passWord" : pas1
            },
            success: function(data){
                parent.layer.msg("修改成功")
            }
        });
    }

</script>
</body>

</html>
